package csc.com.logging;

import java.util.Date;

import org.aspectj.lang.JoinPoint;
import org.springframework.beans.factory.annotation.Autowired;

import csc.com.service.WriteFile;

public class SignInLogging {
	
	private WriteFile writeLog;
	public WriteFile getWriteLog() {
		return writeLog;
	}
	@Autowired
	public void setWriteLog(WriteFile writeLog) {
		this.writeLog = writeLog;
	}

	public void afterAdvice(JoinPoint joinPoint) {
		String content =  joinPoint.getArgs()[0] + " has logged on the system on " + new Date();
		writeLog.writeLog(content);
		
	}
}
